package request

import (
        "topsdk/util"
    )

type TaobaoMiniapppTemplateInstantiateRequest struct {
    /*
        投放端,目前可投放： taobao(淘宝),tmall(天猫)     */
    Clients  *[]string `json:"clients" required:"true" `
    /*
        描述长度(9~200)     */
    Description  *string `json:"description" required:"true" `
    /*
        schemadata, json字符串     */
    ExtJson  *string `json:"ext_json" required:"true" `
    /*
        小程序icon     */
    Icon  *string `json:"icon" required:"true" `
    /*
        小程序名称     */
    Name  *string `json:"name" required:"true" `
    /*
        模板id     */
    TemplateId  *string `json:"template_id" required:"true" `
    /*
        模板版本     */
    TemplateVersion  *string `json:"template_version" required:"true" `
}

func (s *TaobaoMiniapppTemplateInstantiateRequest) SetClients(v []string) *TaobaoMiniapppTemplateInstantiateRequest {
    s.Clients = &v
    return s
}
func (s *TaobaoMiniapppTemplateInstantiateRequest) SetDescription(v string) *TaobaoMiniapppTemplateInstantiateRequest {
    s.Description = &v
    return s
}
func (s *TaobaoMiniapppTemplateInstantiateRequest) SetExtJson(v string) *TaobaoMiniapppTemplateInstantiateRequest {
    s.ExtJson = &v
    return s
}
func (s *TaobaoMiniapppTemplateInstantiateRequest) SetIcon(v string) *TaobaoMiniapppTemplateInstantiateRequest {
    s.Icon = &v
    return s
}
func (s *TaobaoMiniapppTemplateInstantiateRequest) SetName(v string) *TaobaoMiniapppTemplateInstantiateRequest {
    s.Name = &v
    return s
}
func (s *TaobaoMiniapppTemplateInstantiateRequest) SetTemplateId(v string) *TaobaoMiniapppTemplateInstantiateRequest {
    s.TemplateId = &v
    return s
}
func (s *TaobaoMiniapppTemplateInstantiateRequest) SetTemplateVersion(v string) *TaobaoMiniapppTemplateInstantiateRequest {
    s.TemplateVersion = &v
    return s
}

func (req *TaobaoMiniapppTemplateInstantiateRequest) ToMap() map[string]interface{} {
    paramMap := make(map[string]interface{})
    if(req.Clients != nil) {
        paramMap["clients"] = util.ConvertBasicList(*req.Clients)
    }
    if(req.Description != nil) {
        paramMap["description"] = *req.Description
    }
    if(req.ExtJson != nil) {
        paramMap["ext_json"] = *req.ExtJson
    }
    if(req.Icon != nil) {
        paramMap["icon"] = *req.Icon
    }
    if(req.Name != nil) {
        paramMap["name"] = *req.Name
    }
    if(req.TemplateId != nil) {
        paramMap["template_id"] = *req.TemplateId
    }
    if(req.TemplateVersion != nil) {
        paramMap["template_version"] = *req.TemplateVersion
    }
    return paramMap
}

func (req *TaobaoMiniapppTemplateInstantiateRequest) ToFileMap() map[string]interface{} {
    fileMap := make(map[string]interface{})
    return fileMap
}